package com.ysd.lis.controller;

import com.ysd.common.Result;
import com.ysd.lis.controller.pub.BaseController;
import com.ysd.lis.request.CommonPageDto;
import com.ysd.lis.entity.WkSchduleType;
import com.ysd.lis.service.SchduleTypeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Api("排班类型")
@RestController
@RequestMapping("api/scheduletype")
public class SchduleTypeController extends BaseController {

    @Autowired
    SchduleTypeService schduleTypeService;

    @ApiOperation("新增")
    @PostMapping("/addSchduleType")
    public Result addSchduleType(@RequestBody WkSchduleType wkSchduleType){
        return schduleTypeService.addSchduleType(wkSchduleType);
    }

    @ApiOperation("修改")
    @PostMapping("/editSchduleType")
    public Result editSchduleType(@RequestBody WkSchduleType wkSchduleType){
        return schduleTypeService.editSchduleType(wkSchduleType);
    }

    @ApiOperation("分页查询")
    @GetMapping("/findSchduleTypePage")
    public Result findSchduleTypePage(CommonPageDto pageParam){
        return schduleTypeService.findSchduleTypePage(pageParam);
    }

    @ApiOperation("删除")
    @PostMapping("/deleteSchduleType/{id}")
    public Result deleteSchduleType(@PathVariable("id") String id){
        return schduleTypeService.deleteSchduleType(id);
    }
}
